package com.rockblade.generator.enums;

/**
 * @author Administrator
 */
public enum CycleEnum {
    DAY(1, "每天"),
    MONTH(2, "月"),
    WEEK(3, "季"),
    YEAR(4, "年");
    private int codeId;
    private String message;

    CycleEnum(int codeId, String message) {
        this.codeId = codeId;
        this.message = message;
    }

    public static CycleEnum getCycle(int code) {
        for (CycleEnum c : CycleEnum.values()) {
            if (c.codeId == code) {
                return c;
            }
        }
        return null;
    }

    public int getCodeId() {
        return codeId;
    }

    public void setCodeId(int codeId) {
        this.codeId = codeId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
